import request from '@/utils/request'

// 查询黑名单列表
export function listBlacklist(query) {
  return request({
    url: '/blacklist/list',
    method: 'post',
    data: query
  })
}

// 查询黑名单详细
export function getBlacklist(id) {
  return request({
    url: '/blacklist/getById',
    method: 'get',
    params: { id }
  })
}

// 新增黑名单
export function addBlacklist(data) {
  return request({
    url: '/blacklist/add',
    method: 'post',
    data: data
  })
}

// 修改黑名单
export function updateBlacklist(data) {
  return request({
    url: '/blacklist/edit',
    method: 'post',
    data: data
  })
}

// 删除黑名单
export function delBlacklist(id) {
  return request({
    url: '/blacklist/delete',
    method: 'delete',
    params: { id }
  })
}

// 解除所有封禁
export function removeBan() {
  return request({
    url: '/blacklist/removeBan',
    method: 'get'
  })
}

// 批量添加黑名单数据（从Excel导入使用）
export function batchAddBlacklist(data) {
  return request({
    url: '/blacklist/batch',
    method: 'post',
    data: data
  })
}

